#include <iostream>
#include <string>
#include <cassert>


using namespace std;

bool compare(const string &, const string &);

typedef bool (*cmpFcn)(const string &, const string &);

void FunctionPointerTest()
{
	string str1 = "abc", str2 = "1234";
	cmpFcn cmp = compare; // equalivalent : cmpFcn cmp = &compare
	cout << cmp(str1, str2) /*call a function by function pointer*/
		 << (*cmp)(str1, str2)
		 << endl;
}

bool compare(const string &str1, const string &str2)
{
	if(str1.compare(str2) == 0)
		return true;
	else
		return false;
}